from tkinter import *
root = Tk()
root.title('1 этап МАРАФОН 2127')
root.geometry('500x500')
 
canvas = Canvas(bg="white", width=500, height=500)
canvas.pack(anchor=CENTER, expand=1)
x=int(input("Введите координату Х начальной точки: "))
y=int(input("Введите координату Y начальной точки: "))
n=int(input("Введите коффициент увеличения: "))
if n==0 and 0<=x<=500 and 0<=y<=500:
   pass
elif n>0 and ((0*n)+x)>=0 and ((0*n)+y)>=0 and ((20*n)+x)<=500 and ((20*n)+y)<=500:
   pass
elif n<0 and ((20*n)+x)>=0 and ((20*n)+y)>=0 and ((0*n)+x)<=500 and ((0*n)+y)<=500:
   pass
else:
   print("Фигура превысила размеры поля")
   exit()
figure = [0,0,
     10,0,
     10,10,
     20,10,
     20,20,
     20,30,
     10,30,
     10,20,
     0,20,
     0,0
          ]
canvas.create_polygon(figure[0]*n+x, figure[1]*n+y,
                      figure[2]*n+x, figure[3]*n+y,
                      figure[4]*n+x, figure[5]*n+y,
                      figure[6]*n+x, figure[7]*n+y,
                      figure[8]*n+x, figure[9]*n+y,
                      figure[10]*n+x, figure[11]*n+y,
                      figure[12]*n+x, figure[13]*n+y,
                      figure[14]*n+x, figure[15]*n+y,
                      figure[16]*n+x, figure[17]*n+y,
                      figure[18]*n+x, figure[19]*n+y,
                      
                      fill='DarkBlue')
root.mainloop()
